public class GmlLinesDrawer extends GmlStrokeDrawer 
{
  int strokeWeight;
  int strokeColor;
  
  public static final String ID = "TAGEULE_1"; 

  GmlLinesDrawer()
  {
    super(ID);
    setStrokeWeight(1);
    setStrokeColor(0xffffffff);
  }
  
  GmlLinesDrawer(int sw)
  {
    super(ID);
    setStrokeWeight(sw);
    setStrokeColor(0xffffffff);
  }
  
  public void setStrokeWeight(int sw)
  {
    strokeWeight = sw;
  }
  
  public void setStrokeColor(int c)
  {
    strokeColor = c;
  }

  public void draw(PGraphics g, GmlStroke stroke, float scale, float minTime, float maxTime) 
  {
    g.pushStyle();
    g.strokeWeight(this.strokeWeight);
    g.stroke(this.strokeColor);
    g.noFill();
    g.beginShape();
    for (GmlPoint point : stroke.getPoints()) 
    {
      if (point.time < minTime) continue;
      if (point.time > maxTime) break;

      Vec3D v = point.scale(scale);
      g.vertex(v.x, v.y, v.z);
    }
    g.endShape();
    g.popStyle();
  }
}

public class GmlLinesDrawer2D extends GmlLinesDrawer
{
   public GmlLinesDrawer2D(int sw)
   {
     super(sw);
   }
  
    public void draw(PGraphics g, GmlStroke stroke, float scale, float minTime, float maxTime) 
  {
    g.pushStyle();
    g.strokeWeight(this.strokeWeight);
    g.stroke(this.strokeColor);
    g.noFill();
    int nbPoints = stroke.getPoints().size();
    for (int i=0;i<nbPoints-1;i++)
    {
      GmlPoint A = stroke.getPoints().get(i);
      GmlPoint B = stroke.getPoints().get(i+1);
      if (A.time < minTime) continue;
      if (A.time > maxTime) continue;
      g.line(A.x*scale,A.y*scale,B.x*scale,B.y*scale);
    }
    g.popStyle();
  }
};

